Optimal. Leaf size=306 \[ -\frac {b^2 F_1\left (\frac {1}{2};\frac {1}{2} (-1-m),2;\frac {3}{2};\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) (d \sin (e+f x))^{1+m} \sin ^2(e+f x)^{\frac {1}{2} (-1-m)}}{\left (a^2-b^2\right )^2 d f}-\frac {a^2 d F_1\left (\frac {1}{2};\frac {1-m}{2},2;\frac {3}{2};\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) (d \sin (e+f x))^{-1+m} \sin ^2(e+f x)^{\frac {1-m}{2}}}{\left (a^2-b^2\right )^2 f}+\frac {2 a b F_1\left (\frac {1}{2};-\frac {m}{2},2;\frac {3}{2};\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) (d \sin (e+f x))^m \sin ^2(e+f x)^{-m/2}}{\left (a^2-b^2\right )^2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.29, antiderivative size = 306, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2903, 3268,
440, 16} \begin {gather*} -\frac {b^2 \cos (e+f x) \sin ^2(e+f x)^{\frac {1}{2} (-m-1)} (d \sin (e+f x))^{m+1} F_1\left (\frac {1}{2};\frac {1}{2} (-m-1),2;\frac {3}{2};\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right )}{d f \left (a^2-b^2\right )^2}-\frac {a^2 d \cos (e+f x) \sin ^2(e+f x)^{\frac {1-m}{2}} (d \sin (e+f x))^{m-1} F_1\left (\frac {1}{2};\frac {1-m}{2},2;\frac {3}{2};\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac {2 a b \cos (e+f x) \sin ^2(e+f x)^{-m/2} (d \sin (e+f x))^m F_1\left (\frac {1}{2};-\frac {m}{2},2;\frac {3}{2};\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 16
Rule 440
Rule 2903
Rule 3268
Rubi steps
\begin {align*} \int \frac {(d \sin (e+f x))^m}{(a+b \sin (e+f x))^2} \, dx &=\int \left (\frac {a^2 (d \sin (e+f x))^m}{\left (a^2-b^2 \sin ^2(e+f x)\right )^2}-\frac {2 a b \sin (e+f x) (d \sin (e+f x))^m}{\left (a^2-b^2 \sin ^2(e+f x)\right )^2}+\frac {b^2 \sin ^2(e+f x) (d \sin (e+f x))^m}{\left (-a^2+b^2 \sin ^2(e+f x)\right )^2}\right ) \, dx\\ &=a^2 \int \frac {(d \sin (e+f x))^m}{\left (a^2-b^2 \sin ^2(e+f x)\right )^2} \, dx-(2 a b) \int \frac {\sin (e+f x) (d \sin (e+f x))^m}{\left (a^2-b^2 \sin ^2(e+f x)\right )^2} \, dx+b^2 \int \frac {\sin ^2(e+f x) (d \sin (e+f x))^m}{\left (-a^2+b^2 \sin ^2(e+f x)\right )^2} \, dx\\ &=\frac {b^2 \int \frac {(d \sin (e+f x))^{2+m}}{\left (-a^2+b^2 \sin ^2(e+f x)\right )^2} \, dx}{d^2}-\frac {(2 a b) \int \frac {(d \sin (e+f x))^{1+m}}{\left (a^2-b^2 \sin ^2(e+f x)\right )^2} \, dx}{d}-\frac {\left (a^2 d (d \sin (e+f x))^{2 \left (-\frac {1}{2}+\frac {m}{2}\right )} \sin ^2(e+f x)^{\frac {1}{2}-\frac {m}{2}}\right ) \text {Subst}\left (\int \frac {\left (1-x^2\right )^{\frac {1}{2} (-1+m)}}{\left (a^2-b^2+b^2 x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {a^2 d F_1\left (\frac {1}{2};\frac {1-m}{2},2;\frac {3}{2};\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) (d \sin (e+f x))^{-1+m} \sin ^2(e+f x)^{\frac {1-m}{2}}}{\left (a^2-b^2\right )^2 f}-\frac {\left (b^2 (d \sin (e+f x))^{2 \left (\frac {1}{2}+\frac {m}{2}\right )} \sin ^2(e+f x)^{-\frac {1}{2}-\frac {m}{2}}\right ) \text {Subst}\left (\int \frac {\left (1-x^2\right )^{\frac {1+m}{2}}}{\left (-a^2+b^2-b^2 x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{d f}+\frac {\left (2 a b (d \sin (e+f x))^m \sin ^2(e+f x)^{-m/2}\right ) \text {Subst}\left (\int \frac {\left (1-x^2\right )^{m/2}}{\left (a^2-b^2+b^2 x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {b^2 F_1\left (\frac {1}{2};\frac {1}{2} (-1-m),2;\frac {3}{2};\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) (d \sin (e+f x))^{1+m} \sin ^2(e+f x)^{\frac {1}{2} (-1-m)}}{\left (a^2-b^2\right )^2 d f}-\frac {a^2 d F_1\left (\frac {1}{2};\frac {1-m}{2},2;\frac {3}{2};\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) (d \sin (e+f x))^{-1+m} \sin ^2(e+f x)^{\frac {1-m}{2}}}{\left (a^2-b^2\right )^2 f}+\frac {2 a b F_1\left (\frac {1}{2};-\frac {m}{2},2;\frac {3}{2};\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) (d \sin (e+f x))^m \sin ^2(e+f x)^{-m/2}}{\left (a^2-b^2\right )^2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(1790\) vs. \(2(306)=612\).
time = 16.48, size = 1790, normalized size = 5.85 \begin {gather*} -\frac {\sec ^2(e+f x)^{m/2} (d \sin (e+f x))^m \tan (e+f x) \left (\frac {\tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^m \left (-a \left (a^2+b^2\right ) (2+m) F_1\left (\frac {1+m}{2};\frac {m}{2},1;\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right )+2 b \left (a b (2+m) F_1\left (\frac {1+m}{2};\frac {m}{2},2;\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right )+\left (a^2-b^2\right ) (1+m) F_1\left (\frac {2+m}{2};\frac {1}{2} (-1+m),2;\frac {4+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \tan (e+f x)\right )\right )}{a^3 \left (a^2-b^2\right ) f (1+m) (2+m) (a+b \sin (e+f x))^2 \left (-\frac {\sec ^2(e+f x)^{1+\frac {m}{2}} \left (\frac {\tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^m \left (-a \left (a^2+b^2\right ) (2+m) F_1\left (\frac {1+m}{2};\frac {m}{2},1;\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right )+2 b \left (a b (2+m) F_1\left (\frac {1+m}{2};\frac {m}{2},2;\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right )+\left (a^2-b^2\right ) (1+m) F_1\left (\frac {2+m}{2};\frac {1}{2} (-1+m),2;\frac {4+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \tan (e+f x)\right )\right )}{a^3 \left (a^2-b^2\right ) (1+m) (2+m)}-\frac {m \sec ^2(e+f x)^{m/2} \tan ^2(e+f x) \left (\frac {\tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^m \left (-a \left (a^2+b^2\right ) (2+m) F_1\left (\frac {1+m}{2};\frac {m}{2},1;\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right )+2 b \left (a b (2+m) F_1\left (\frac {1+m}{2};\frac {m}{2},2;\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right )+\left (a^2-b^2\right ) (1+m) F_1\left (\frac {2+m}{2};\frac {1}{2} (-1+m),2;\frac {4+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \tan (e+f x)\right )\right )}{a^3 \left (a^2-b^2\right ) (1+m) (2+m)}-\frac {m \sec ^2(e+f x)^{m/2} \tan (e+f x) \left (\frac {\tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^{-1+m} \left (\sqrt {\sec ^2(e+f x)}-\frac {\tan ^2(e+f x)}{\sqrt {\sec ^2(e+f x)}}\right ) \left (-a \left (a^2+b^2\right ) (2+m) F_1\left (\frac {1+m}{2};\frac {m}{2},1;\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right )+2 b \left (a b (2+m) F_1\left (\frac {1+m}{2};\frac {m}{2},2;\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right )+\left (a^2-b^2\right ) (1+m) F_1\left (\frac {2+m}{2};\frac {1}{2} (-1+m),2;\frac {4+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \tan (e+f x)\right )\right )}{a^3 \left (a^2-b^2\right ) (1+m) (2+m)}-\frac {\sec ^2(e+f x)^{m/2} \tan (e+f x) \left (\frac {\tan (e+f x)}{\sqrt {\sec ^2(e+f x)}}\right )^m \left (-a \left (a^2+b^2\right ) (2+m) \left (-\frac {m (1+m) F_1\left (1+\frac {1+m}{2};1+\frac {m}{2},1;1+\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \sec ^2(e+f x) \tan (e+f x)}{3+m}+\frac {2 \left (-1+\frac {b^2}{a^2}\right ) (1+m) F_1\left (1+\frac {1+m}{2};\frac {m}{2},2;1+\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \sec ^2(e+f x) \tan (e+f x)}{3+m}\right )+2 b \left (\left (a^2-b^2\right ) (1+m) F_1\left (\frac {2+m}{2};\frac {1}{2} (-1+m),2;\frac {4+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \sec ^2(e+f x)+a b (2+m) \left (-\frac {m (1+m) F_1\left (1+\frac {1+m}{2};1+\frac {m}{2},2;1+\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \sec ^2(e+f x) \tan (e+f x)}{3+m}+\frac {4 \left (-1+\frac {b^2}{a^2}\right ) (1+m) F_1\left (1+\frac {1+m}{2};\frac {m}{2},3;1+\frac {3+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \sec ^2(e+f x) \tan (e+f x)}{3+m}\right )+\left (a^2-b^2\right ) (1+m) \tan (e+f x) \left (-\frac {(-1+m) (2+m) F_1\left (1+\frac {2+m}{2};1+\frac {1}{2} (-1+m),2;1+\frac {4+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \sec ^2(e+f x) \tan (e+f x)}{4+m}+\frac {4 \left (-1+\frac {b^2}{a^2}\right ) (2+m) F_1\left (1+\frac {2+m}{2};\frac {1}{2} (-1+m),3;1+\frac {4+m}{2};-\tan ^2(e+f x),\left (-1+\frac {b^2}{a^2}\right ) \tan ^2(e+f x)\right ) \sec ^2(e+f x) \tan (e+f x)}{4+m}\right )\right )\right )}{a^3 \left (a^2-b^2\right ) (1+m) (2+m)}\right )} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 1.21, size = 0, normalized size = 0.00 \[\int \frac {\left (d \sin \left (f x +e \right )\right )^{m}}{\left (a +b \sin \left (f x +e \right )\right )^{2}}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (d\,\sin \left (e+f\,x\right )\right )}^m}{{\left (a+b\,\sin \left (e+f\,x\right )\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________